package com.djw.service.impl;

import com.djw.mapper.UserMapper;
import com.djw.model.User;
import com.djw.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public int insert(User user) {
        return userMapper.insert(user);
    }

    @Override
    public User getUser(String id) {
        return userMapper.selectByPrimaryKey(id);
    }

    @Override
    public User selectUser(String name) {
        return userMapper.getUserByName(name);
    }

}
